<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>启动</title>
</head>

<body>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/request.js"></script>
<script type="text/javascript" src="../script/window.js"></script>
<script>
    function initFront() {
        api.setStatusBarStyle({
            style: 'dark'
        });
    }

    function initEvent() {

        api.addEventListener({
            name: 'viewappear'
        }, function(ret, error) {

            setTimeout(function() {
                dispathWindow();
            }, 100);

        });
    }

    function dispathWindow() {
        var request = new Request('root');
        if (request.isLogin()) {

            if(request.isEnterpriseUser()){
                enterprise();
            }
            else{
                dashboard();
            }

        } else {
            login();
        }
    }

    apiready = function() {

        initEvent();

        initFront();
    }
</script>

</html>
